﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace WPFStudy.Command
{
    /// <summary>
    /// 命令窗口命令
    /// </summary>
    public class CommandWindowCmd : ICommand
    {
        Action _execAction;
        public CommandWindowCmd(Action execAction)
        {
            _execAction = execAction;
        }

        public event EventHandler? CanExecuteChanged;

        public bool CanExecute(object? parameter)
        {
            return true;
        }

        public void Execute(object? parameter)
        {
            _execAction();
        }
    }
}
